#!/usr/bin/env python
# -*- coding: UTF-8 -*-

# Constants
PACKAGE_NAME_SEPERATOR = '.'

# Enums
class CommandType:
    '''
    '''
    TEXT = 1
    STORE_PROCEDURE = 4

class DbType:
    '''
    '''
    STRING = 1
    INTEGER = 2
    LONG = 3
    DECIMAL = 4
    DATETIME = 5
    DATE = 6
    END_DATE = 16
    END_MONTH = 17
    END_YEAR = 18
    FLOAT = 7
    DOUBLE = 8
    BOOL = 9
    BINARY = 10

class MatchType:
    '''
    '''
    EXACT = 1
    STARTS_WITH = 2
    ENDS_WITH = 3
    CONTAINS = 4

class Direction:
    '''
    '''
    INPUT = 1
    OUTPUT = 2
    INPUT_OUTPUT = 3

class ResultType:
    '''
    '''
    TABLE = 1
    STRING = 101
    INT32 = 102
    INT16 = 103
    INT64 = 104
    DECIMAL = 105
    DATETIME = 106
    FLOAT = 107
    DOUBLE = 108
    BOOLEAN = 109
    STRING_LIST = 201
    INT32_LIST = 202
    INT16_LIST = 203
    INT64_LIST = 204
    DECIMAL_LIST = 205
    DATETIME_LIST = 206
    FLOAT_LIST = 207
    DOUBLE_LIST = 208
    BOOLEAN_LIST = 209
    UPDATED_ROWS = 400

class DynamicTextType:
    '''
    '''
    EXISTS = 1
    NOT_EXISTS = 2
    IS_NULL = 3
    IS_NOT_NULL = 4
    IS_EMPTY = 5
    IS_NOT_EMPTY = 6
    IS_NULL_OR_EMPTY = 7

# Classes

class DbTable(object):
    '''
    '''

class DbColumn(object):
    '''
    '''

class DbParameter(object):
    '''
    '''

class DbModule(object):
    '''
    '''

class DbStatement(object):
    '''
    '''

class DbDynamic(object):
    '''
    '''
    def __init__(self):
        self.data = []

    def append(self, obj):
        self.data.append(obj)

    def __len__(self):
        return len(self.data)

    def __setitem(self, key, value):
        self.data[key] = value
        
    def __getitem__(self, key):
        return self.data[key]

    def __contains__(self, obj):
        return obj in self.data

# Functions
def to_pascal(s):
    '''
    '''
    if not s:
        return ''

    words = [__to_pascal(w) for w in s.split('.')]
    return '.'.join(words)

def __to_pascal(s):
    '''
    '''
    if not s:
        return ''
    else:
        return s.title().replace('_', '')


def to_camel(s):
    '''
    '''
    if not s:
        return ''

    words = [__to_camel(w) for w in s.split('.')]
    return '.'.join(words)

def __to_camel(s):
    '''
    '''
    if not s:
        return ''
    else:
        ss = s.title().replace('_', '')
        return ss[:1].lower() + ss[1:]

def to_lower(s):
    '''
    '''
    if not s:
        return ''

    words = [__to_lower(w) for w in s.split('.')]
    return '.'.join(words)

def __to_lower(s):
    '''
    '''
    if not s:
        return ''
    else:
        return s.lower().replace('_', '')

def to_upper(s):
    '''
    '''
    if not s:
        return ''

    words = [__to_upper(w) for w in s.split('.')]
    return '.'.join(words)

def __to_upper(s):
    '''
    '''
    if not s:
        return ''
    else:
        return s.upper().replace('_', '')

